package cn.edu.scau.cmi.limingben.hibernateprog.model.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HIbernateSessionFactoryUtil {
	private static SessionFactory factory;

	private static SessionFactory getFactory() {
		if (factory == null)
			factory = new Configuration().configure().buildSessionFactory();
		return factory;
	}

	public static Session getSession() {
		return getFactory().openSession();
	}
}
